package edu.sctu.practice.class02.shilaihong.assign02;

/**
 * Created by admin on 2015/10/10.
 */
public class Rational {
    double value1;
    double value2;

    public Rational(double value1, double value2) {
        this.value1 = value1;
        this.value2 = value2;
    }

    public double add() {
        return value1 + value2;
    }

    public double minus() {
        return value1 - value2;
    }

    public double mulitiple() {
        return value1 * value2;
    }

    public double divide() {
        double t1 = value1;
        double t2 = value2;
        if (t2 != 0) {
            double remainder = t1 % t2;
            return t2;
        } else {
            return 0;
        }
    }
}
